﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace NBBL_Tile_Editor
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            //Application.Run(new MainForm());

            //Make the form
            MainForm tileEditor = new MainForm();

            //display the form
            tileEditor.Show();

            //Starting time
            int timeNow = System.Environment.TickCount;

            //Main program loop
            while (tileEditor.Looping)
            {
                //Elapsed time stuff
                int timeBefore = timeNow;
                timeNow = System.Environment.TickCount;
                float dt = (timeNow - timeBefore) / 1000.0f;

                //Editor's Update
                tileEditor.Update( dt );

                //Editor's Render
                tileEditor.Render();

                //Handle events
                Application.DoEvents();
            }
        }
    }
}
